package com.yylany.service;

import com.yylany.mapper.TbBrandMapper;
import com.yylany.pojo.TbBrand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Description: pinyougou
 *
 * @author <a href="mailto:17777502615@163.com">yaoyonglong</a>
 * @date 2018/12/19
 * @since 1.0.0
 */
@Service
public class BrandService {


    private TbBrandMapper brandMapper;

    @Autowired
    public BrandService(TbBrandMapper brandMapper) {
        this.brandMapper = brandMapper;
    }

    /**
     * 通过CategoryId 查询所有的品牌
     *
     * @param catid CategoryId
     * @return List<TbBrand>
     */
    public List<TbBrand> brands(int catid) {
        List<TbBrand> allByCategoryId = brandMapper.findAllByCategoryId(catid, 8);

        return allByCategoryId;
    }


}
